/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package action;

import com.opensymphony.xwork2.ActionSupport;
import dao.UserDAO;
import dto.User;
import java.util.List;
import util.ConnectDB;
import util.IdbUtil;

/**
 *
 * @author Thinh
 */
public class AdminController extends BaseController {

    private UserDAO _userDAO;
    private List<User> users;
    public AdminController() {
        _database = new ConnectDB();
        _userDAO = new UserDAO(_database);
    }

    public String load() {
        return SUCCESS;
    }

    public String LoadUser() {
        try {
            users = (List<User>)_userDAO.getAll();
        } catch (Exception ex) {
            //Log here
            ex.printStackTrace();
            return ERROR;
        }
        return SUCCESS;
    }

    /**
     * @return the _users
     */
    public List<User> getUsers() {
        return users;
    }

    /**
     * @param users the _users to set
     */
    public void setUsers(List<User> users) {
        this.users = users;
    }

    
    
}
